﻿/*

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace FileSystemControls
{
    //http://msdn.microsoft.com/en-us/library/ms171820.aspx

    //Can't actually add items, the designer will add items to the control.
    //Have to fake it with painting.
    //This may mean I have to gut the OnDrawSubItem method.
    //Or maybe I could try adding Glyphs and see what they do.
    //I think Glyphs are more like buttons for accepting input about the control and that's not what I need.
    class FileSystemListViewDesigner : ControlDesigner
    {
        FileSystemListView _currentListView;
        SolidBrush _fontBrush;

        public FileSystemListViewDesigner()
        {
        }

        protected override void OnPaintAdornments(PaintEventArgs argEventArgs)
        {
            Rectangle CurrentRectangle;
            LinearGradientBrush CurrentBrush;

            //using (StreamWriter logwriter = File.AppendText(@"C:\$hank\Projects\FileTracker\FileTracker\bin\Debug\LogFile.txt"))
            //{
            //logwriter.WriteLine("OnPaintAdornments\r\n");

            //Get current FileSystemListView
            _currentListView = this.Control as FileSystemListView;

            ////Make Font Brush
            _fontBrush = new SolidBrush(_currentListView.ForeColor);

            //Make Name Dir boxes
            CurrentRectangle = new Rectangle(new Point(_currentListView.NameHeaderRectangle.X, _currentListView.NameHeaderRectangle.Y + _currentListView.NameHeaderRectangle.Height), _currentListView.NameHeaderRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.NameColors.PlainSettings.Color1, _currentListView.DirectorySettings.NameColors.PlainSettings.Color2, _currentListView.DirectorySettings.NameColors.PlainSettings.Direction);
            DrawItem(e.Graphics, @"Plain Dir", CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.NameColors.MouseOverSettings.Color1, _currentListView.DirectorySettings.NameColors.MouseOverSettings.Color2, _currentListView.DirectorySettings.NameColors.MouseOverSettings.Direction);
            DrawItem(e.Graphics, @"MouseOver Dir", CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.NameColors.SelectedSettings.Color1, _currentListView.DirectorySettings.NameColors.SelectedSettings.Color2, _currentListView.DirectorySettings.NameColors.SelectedSettings.Direction);
            DrawItem(e.Graphics, @"Selected Dir", CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.NameColors.SelectedMouseOverSettings.Color1, _currentListView.DirectorySettings.NameColors.SelectedMouseOverSettings.Color2, _currentListView.DirectorySettings.NameColors.SelectedMouseOverSettings.Direction);
            DrawItem(e.Graphics, @"Selected MouseOver Dir", CurrentRectangle, CurrentBrush);

            //~~ Name File boxes
            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.FileSettings.NameColors.PlainSettings.Color1, _currentListView.FileSettings.NameColors.PlainSettings.Color2, _currentListView.FileSettings.NameColors.PlainSettings.Direction);
            DrawItem(e.Graphics, @"Plain File", CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.FileSettings.NameColors.MouseOverSettings.Color1, _currentListView.FileSettings.NameColors.MouseOverSettings.Color2, _currentListView.FileSettings.NameColors.MouseOverSettings.Direction);
            DrawItem(e.Graphics, @"MouseOver File", CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.FileSettings.NameColors.SelectedSettings.Color1, _currentListView.FileSettings.NameColors.SelectedSettings.Color2, _currentListView.FileSettings.NameColors.SelectedSettings.Direction);
            DrawItem(e.Graphics, @"Selected File", CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.FileSettings.NameColors.SelectedMouseOverSettings.Color1, _currentListView.FileSettings.NameColors.SelectedMouseOverSettings.Color2, _currentListView.FileSettings.NameColors.SelectedMouseOverSettings.Direction);
            DrawItem(e.Graphics, @"Selected MouseOver File", CurrentRectangle, CurrentBrush);

            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            //Draw Size boxes
            CurrentRectangle = new Rectangle(new Point(_currentListView.SizeHeaderRectangle.X, _currentListView.SizeHeaderRectangle.Y + _currentListView.SizeHeaderRectangle.Height), _currentListView.SizeHeaderRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.SizeColors.PlainSettings.Color1, _currentListView.DirectorySettings.SizeColors.PlainSettings.Color2, _currentListView.DirectorySettings.SizeColors.PlainSettings.Direction);
            DrawItem(e.Graphics, @"<Dir>", CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.SizeColors.MouseOverSettings.Color1, _currentListView.DirectorySettings.SizeColors.MouseOverSettings.Color2, _currentListView.DirectorySettings.SizeColors.MouseOverSettings.Direction);
            DrawItem(e.Graphics, @"<Dir>", CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.SizeColors.SelectedSettings.Color1, _currentListView.DirectorySettings.SizeColors.SelectedSettings.Color2, _currentListView.DirectorySettings.SizeColors.SelectedSettings.Direction);
            DrawItem(e.Graphics, @"<Dir>", CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.SizeColors.SelectedMouseOverSettings.Color1, _currentListView.DirectorySettings.SizeColors.SelectedMouseOverSettings.Color2, _currentListView.DirectorySettings.SizeColors.SelectedMouseOverSettings.Direction);
            DrawItem(e.Graphics, @"<Dir>", CurrentRectangle, CurrentBrush);

            //Draw Date boxes
            CurrentRectangle = new Rectangle(new Point(_currentListView.DateHeaderRectangle.X, _currentListView.DateHeaderRectangle.Y + _currentListView.DateHeaderRectangle.Height), _currentListView.DateHeaderRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.DateColors.PlainSettings.Color1, _currentListView.DirectorySettings.DateColors.PlainSettings.Color2, _currentListView.DirectorySettings.DateColors.PlainSettings.Direction);
            DrawItem(e.Graphics, DateTime.Now.ToShortDateString(), CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.DateColors.MouseOverSettings.Color1, _currentListView.DirectorySettings.DateColors.MouseOverSettings.Color2, _currentListView.DirectorySettings.DateColors.MouseOverSettings.Direction);
            DrawItem(e.Graphics, DateTime.Now.ToShortDateString(), CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.DateColors.SelectedSettings.Color1, _currentListView.DirectorySettings.DateColors.SelectedSettings.Color2, _currentListView.DirectorySettings.DateColors.SelectedSettings.Direction);
            DrawItem(e.Graphics, DateTime.Now.ToShortDateString(), CurrentRectangle, CurrentBrush);

            CurrentRectangle = new Rectangle(new Point(CurrentRectangle.X, CurrentRectangle.Y + CurrentRectangle.Height), CurrentRectangle.Size);
            CurrentBrush = new LinearGradientBrush(CurrentRectangle, _currentListView.DirectorySettings.DateColors.SelectedMouseOverSettings.Color1, _currentListView.DirectorySettings.DateColors.SelectedMouseOverSettings.Color2, _currentListView.DirectorySettings.DateColors.SelectedMouseOverSettings.Direction);
            DrawItem(e.Graphics, DateTime.Now.ToShortDateString(), CurrentRectangle, CurrentBrush);

            //} // using logwriter

        }

        private void DrawItem(Graphics CurrentGraphics, string CurrentText, Rectangle CurrentRectangle, LinearGradientBrush CurrentBrush)
        {

            CurrentGraphics.FillRectangle(CurrentBrush, CurrentRectangle);
            CurrentGraphics.DrawString(CurrentText, _currentListView.Font, _fontBrush, CurrentRectangle);
        }

    }


}

*/
